let tor ='https://marskino.otkuy.cn';
globalThis.opnid ='ozQRn6k1UO1ImT9XxtI3OKefPkoY'
globalThis.name='مارىس كىنو';
globalThis.getHeaders= function(){
    let headers = {     
        'User-Agent': 'Mozilla/5.0 (Linux; Android 11; PCEM00 Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300333 MMWEBSDK/20241103 MMWEBID/9272 MicroMessenger/8.0.54.2760(0x28003653) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64',
    'Content-Type': 'application/json',
        'token': token,
        'Origin': tor,
         };return headers
};
globalThis.tor1 = tor,
globalThis.playsign= function(t){
 let url =  tor+'/apis/vipsList?openid='+opnid;
  let html = request(url);
  let json = JSON.parse(html);
  let data =json.data.user;
  let openid =data.openid;
  let unionId =data.unionId;
  globalThis.id = data.id;
  globalThis.token =data.token;
  let e=md5("Berip aqagnigkini mara"+openid+unionId+t+token+"Berip aqagnigkini mara");   
 let playsign=md5("Berip aqagnigkini mara"+e);
 return playsign
}
globalThis.get_other_episode= function(input){
    let url1 = tor1+'/apis/get_other_episode';
let url2 =  tor1+'/apis/vipsList?openid='+opnid;
let html2 = request(url2);
  let k = JSON.parse(html2);
  let h =k.data.user;
  let kid =h.openid;
  let nId =h.unionId;
    let tm = Math.floor(Date.now() / 1000);
    let body1 = ({
        id: input,
        openid: kid,
        unionId: nId,
        time: tm,
        sign: playsign(tm),
    });
    let html1 =fetch(url1, {
            method: 'POST',
            headers: getHeaders(),
            body: body1,
        });
    let json1 = JSON.parse(html1);
    let sites = json1.data[1];
    let currentIndex = 1;
    let d = sites.map(function (it) {
        let _uu = it.id+'￥'+it.mov_pid;
        let combinedString = `${currentIndex + 1}$${_uu}`;
        currentIndex++;
        return combinedString;
    });
    return d
}
globalThis.getMyEpisode= function(input){
    let url2 = tor1+'/apis/getMyEpisode';
let url1 =  tor1+'/apis/vipsList?openid='+opnid;
let html1 = request(url1);
  let k = JSON.parse(html1);
  let h =k.data.user;
  let kid =h.openid;
  let nId =h.unionId;
    let parts = input.split('￥');
    let curId = parseInt(parts[0], 10); 
    let pid = parseInt(parts[1], 10); 
    let body2 = ({
        curId: curId,
        openid: kid,
        uid: nId,
        pid:pid
    }); 
     let html2 =fetch(url2, {
            method: 'POST',
            headers: getHeaders(),
            body:body2,
        });
    let json2 = JSON.parse(html2);
    let playurl = json2.data.url;  
    return playurl
  
}
let url = tor+'/apis/getCates?time=1738480917&sign=5e04769eef8367eb2a5e7f4e81c748f5';
let h = JSON.parse(fetch(url, {
    headers: {
        'User-Agent': 'MOBILE_UA'
    }
}));
let getn = ['بارلىق'];
let getu = [0];
let jsonData = h.data.lan;
for (let k = 0; k < jsonData.length; k++) {
    let hasNonEmptyField = false;
    getn.push(jsonData[k].cate_name);
    getu.push(jsonData[k].id);
};
globalThis.getname = getn.join("&");
globalThis.geturl = getu.join("&");
var rule = {
title: name,
host: tor,
homeUrl: '/apis/get_category_mov?page=1&region=&year=&type=&lan=&time=1718163458&sign=2dc042a72b488d866f8ddcfdab632bd3',
detailUrl: 'fyid',
searchUrl: '/apis/search?keyword=**&page=fypage&time=1736995295&sign=cebf8f6a7dafc3098dafb1a81f44fdbe',
url:'/apis/get_category_mov?fyfilter&page=fypage&time=1738428475&sign=ff2315c2fc6e52fb9184374a94f8c306',
filterable: 1,
filter_url: 'region={{fl.地区}}&year={{fl.年代}}&type={{fl.类型}}&lan=fyclass',
filter: {
    'كىنو': [{ 'key': '类型', 'name': '类型', 'value': [{ 'n': '全部', 'v': '' }, { 'n': 'مۇھەببەتلىك', 'v': 'مۇھەببەتلىك' }, { 'n': 'كومىدىيەلىك', 'v': 'كومىدىيەلىك' }, { 'n': 'قورقۇنۇچلۇق', 'v': 'قورقۇنۇچلۇق' }, { 'n': 'جاسۇسلۇق', 'v': 'جاسۇسلۇق' }, { 'n': 'فانتازىيەلىك', 'v': 'فانتازىيەلىك' }, { 'n': 'ھەركەتلىك', 'v': 'ھەركەتلىك' }, { 'n': 'تىراگىدىيەلىك', 'v': 'تىراگىدىيەلىك' }, { 'n': 'ئۇرۇش', 'v': 'ئۇرۇش' }, { 'n': 'تارىخى', 'v': 'تارىخى' }, { 'n': 'جىنايەت', 'v': 'جىنايەت' }, { 'n': 'كارتون', 'v': 'كارتون' }, { 'n': 'ۋەقەلىك', 'v': 'ۋەقەلىك' }] }, { 'key': '地区', 'name': '地区', 'value': [{ 'n': '全部', 'v': '' }, { 'n': 'جۇڭگۇ', 'v': 'جۇڭگۇ' }, { 'n': 'ئامېرىكا', 'v': 'ئامېرىكا' }, { 'n': 'ھېندىستان', 'v': 'ھېندىستان' }, { 'n': 'كورىيە', 'v': 'كورىيە' }, { 'n': 'ياپۇنيە', 'v': 'ياپۇنيە' }, { 'n': 'تايلاند', 'v': 'تايلاند' }, { 'n': 'باشقىلار', 'v': 'باشقىلار' }] }, { 'key': '年代', 'name': '年代', 'value': [{ 'n': '全部', 'v': '' }, { 'n': '2024', 'v': '2024' }, { 'n': '2023', 'v': '2023' }, { 'n': '2022', 'v': '2022' }, { 'n': '2021', 'v': '2021' }, { 'n': '2020', 'v': '2020' }, { 'n': '2019', 'v': '2019' }, { 'n': '2018', 'v': '2018' }, { 'n': '2017', 'v': '2017' }, { 'n': '2016', 'v': '2016' }, { 'n': '2015', 'v': '2015' }, { 'n': '2014', 'v': '2014' }, { 'n': '2010-', 'v': '2010-' }] }],
    'قىسىملىق': [{ 'key': '类型', 'name': '类型', 'value': [{ 'n': '全部', 'v': '' }, { 'n': 'مۇھەببەتلىك', 'v': 'مۇھەببەتلىك' }, { 'n': 'كومىدىيەلىك', 'v': 'كومىدىيەلىك' }, { 'n': 'قورقۇنۇچلۇق', 'v': 'قورقۇنۇچلۇق' }, { 'n': 'جاسۇسلۇق', 'v': 'جاسۇسلۇق' }, { 'n': 'فانتازىيەلىك', 'v': 'فانتازىيەلىك' }, { 'n': 'ھەركەتلىك', 'v': 'ھەركەتلىك' }, { 'n': 'تىراگىدىيەلىك', 'v': 'تىراگىدىيەلىك' }, { 'n': 'ئۇرۇش', 'v': 'ئۇرۇش' }, { 'n': 'تارىخى', 'v': 'تارىخى' }, { 'n': 'جىنايەت', 'v': 'جىنايەت' }, { 'n': 'كارتون', 'v': 'كارتون' }, { 'n': 'ۋەقەلىك', 'v': 'ۋەقەلىك' }] }, { 'key': '地区', 'name': '地区', 'value': [{ 'n': '全部', 'v': '' }, { 'n': 'جۇڭگۇ', 'v': 'جۇڭگۇ' }, { 'n': 'ئامېرىكا', 'v': 'ئامېرىكا' }, { 'n': 'ھېندىستان', 'v': 'ھېندىستان' }, { 'n': 'كورىيە', 'v': 'كورىيە' }, { 'n': 'ياپۇنيە', 'v': 'ياپۇنيە' }, { 'n': 'تايلاند', 'v': 'تايلاند' }, { 'n': 'باشقىلار', 'v': 'باشقىلار' }] }, { 'key': '年代', 'name': '年代', 'value': [{ 'n': '全部', 'v': '' }, { 'n': '2024', 'v': '2024' }, { 'n': '2023', 'v': '2023' }, { 'n': '2022', 'v': '2022' }, { 'n': '2021', 'v': '2021' }, { 'n': '2020', 'v': '2020' }, { 'n': '2019', 'v': '2019' }, { 'n': '2018', 'v': '2018' }, { 'n': '2017', 'v': '2017' }, { 'n': '2016', 'v': '2016' }, { 'n': '2015', 'v': '2015' }, { 'n': '2014', 'v': '2014' }, { 'n': '2010-', 'v': '2010-' }] }]

},
filter_def: {},
headers: {
    'User-Agent': 'Mozilla/5.0 (Linux; Android 11; PCEM00 Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300333 MMWEBSDK/20241103 MMWEBID/9272 MicroMessenger/8.0.54.2760(0x28003653) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64',
    'Content-Type': 'application/json',
},
timeout: 5000,
class_name: getname,
class_url: getname,
searchable: 2,
play_parse: true,
lazy: $js.toString(() => {
    if (input.includes('https')) {
    input = { parse: 1, url: input, js: '' };
    } else if (input.startsWith('wxv')) {
    input = 'https://vid.losfer.cn/v/?auto=' + input;
    input = { parse: 1, url: input, js: '' };
    }else if (input.includes('￥')) {
     let parts = input.split('￥');
    let curId = parseInt(parts[0], 10); 
    input=getMyEpisode(input);
    input = { parse: 1, url: input, js: '' };
    
    };
}),
double: true,
//推荐: 'json:data;mov_title;mov_img;mov_cate;id;mov_lang',
一级: 'json:data;mov_title;mov_img;mov_cate;id;mov_lang',
二级: '',
二级: $js.toString(() => {
    let vodItems = [];
     input = input.split("/").pop();
    let url = tor1+'/apis/get_mov_detail';
let url1 =  tor1+'/apis/vipsList?openid='+opnid;
let html1 = request(url1);
  let k = JSON.parse(html1);
  let h =k.data.user;
  let kid =h.openid;
  let nId =h.unionId;
    let t = Math.floor(Date.now() / 1000);
    let body = ({
        id: input,
        openid: kid,
        unionId: nId,
        time: t,
        sign: playsign(t),
        agent: id
    });
    let html =fetch(url, {
            method: 'POST',
            headers: getHeaders(),
            body: body,
        });
    let json = JSON.parse(html);
    let data = json.data.all;
    let tilte = data.mov_title;
    let img = data.mov_img;
    let vod_type = data.mov_cate;
    let area = data.mov_region;
    let content = data.mov_desc;
    let all = data.all;
    let base_vod = {
        vod_id: input,
        vod_name: tilte,
        type_name: vod_type,
        vod_year: '',
        vod_area: '',
        vod_actor: '',
        vod_director: name+ 'كىنوخانىسى-',
        vod_content: content,
        vod_remarks: area,
        vod_pic: img
    };
    let sites = json.data.episode;
    if (sites.length > 0) {
        let kisim = sites[0];
        let _uu = kisim.id + '￥' + kisim.mov_pid;
        let combinedString = `1$${_uu}`;
        vodItems.push(combinedString);
vodItems.push(get_other_episode(input).join("#"));
    }
let vod_play_url = vodItems.join("#");
base_vod.vod_play_url = vod_play_url;
let vod_play_from = name + '_Tv';
base_vod.vod_play_from = vod_play_from;
VOD = base_vod;
}),
搜索: 'json:data;mov_title;mov_img;mov_cate;id;mov_lang',
}
